home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Patches 1998 April / IRIX 6.4 Recommended-Required Patches April 1998.img / dist / 6.4_OCTANE / patchSG0002839.idb / usr / include / procfs / procfs.h.z / procfs.h
C/C++ Source or Header  |  1998-04-01  |  20KB  |  483 lines

  1. /*    Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. /**************************************************************************
  11.  *                                      *
  12.  *          Copyright (C) 1990, Silicon Graphics, Inc.          *
  13.  *                                      *
  14.  *  These coded instructions, statements, and computer programs  contain  *
  15.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  16.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  17.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  18.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  19.  *                                      *
  20.  **************************************************************************/
  21.  
  22. #ifndef _FS_PROCFS_PROCFS_H    /* wrapper symbol for kernel use */
  23. #define _FS_PROCFS_PROCFS_H    /* subject to change without notice */
  24.  
  25. #ident    "$Revision: 1.78 $"
  26.  
  27. #include <sys/extacct.h>
  28. #include <sys/fault.h>
  29. #include <sys/siginfo.h>
  30. #include <sys/signal.h>
  31. #include <sys/syscall.h>
  32. #include <sys/time.h>
  33. #include <sys/ucontext.h>
  34.  
  35. /*
  36.  * ioctl codes and system call interfaces for /proc.
  37.  */
  38. #define PIOC        ('q'<<8)
  39. #define PIOCSTATUS    (PIOC|1)    /* get process status */
  40. #define PIOCSTOP    (PIOC|2)    /* post STOP request and... */
  41. #define PIOCWSTOP    (PIOC|3)    /* wait for process to STOP */
  42. #define PIOCRUN        (PIOC|4)    /* make process runnable */
  43. #define PIOCGTRACE    (PIOC|5)    /* get traced signal set */
  44. #define PIOCSTRACE    (PIOC|6)    /* set traced signal set */
  45. #define PIOCSSIG    (PIOC|7)    /* set current signal */
  46. #define PIOCKILL    (PIOC|8)    /* send signal */
  47. #define PIOCUNKILL    (PIOC|9)    /* delete a signal */
  48. #define PIOCGHOLD    (PIOC|10)    /* get held signal set */
  49. #define PIOCSHOLD    (PIOC|11)    /* set held signal set */
  50. #define PIOCMAXSIG    (PIOC|12)    /* get max signal number */
  51. #define PIOCACTION    (PIOC|13)    /* get signal action structs */
  52. #define PIOCGFAULT    (PIOC|14)    /* get traced fault set */
  53. #define PIOCSFAULT    (PIOC|15)    /* set traced fault set */
  54. #define PIOCCFAULT    (PIOC|16)    /* clear current fault */
  55. #define PIOCGENTRY    (PIOC|17)    /* get syscall entry set */
  56. #define PIOCSENTRY    (PIOC|18)    /* set syscall entry set */
  57. #define PIOCGEXIT    (PIOC|19)    /* get syscall exit set */
  58. #define PIOCSEXIT    (PIOC|20)    /* set syscall exit set */
  59. /*
  60.  * These four are obsolete (replaced by PIOCSET/PIOCRESET)
  61.  */
  62. #define PIOCSFORK    (PIOC|21)    /* set inherit-on-fork flag */
  63. #define PIOCRFORK    (PIOC|22)    /* reset inherit-on-fork flag */
  64. #define PIOCSRLC    (PIOC|23)    /* set run-on-last-close flag */
  65. #define PIOCRRLC    (PIOC|24)    /* reset run-on-last-close flag */
  66.  
  67. #define PIOCGREG    (PIOC|25)    /* get general registers */
  68. #define PIOCSREG    (PIOC|26)    /* set general registers */
  69. #define PIOCGFPREG    (PIOC|27)    /* get floating-point registers */
  70. #define PIOCSFPREG    (PIOC|28)    /* set floating-point registers */
  71. #define PIOCNICE    (PIOC|29)    /* set nice priority */
  72. #define PIOCPSINFO    (PIOC|30)    /* get ps(1) information */
  73. #define PIOCNMAP    (PIOC|31)    /* get number of memory mappings */
  74. #define PIOCMAP        (PIOC|32)    /* get memory map information */
  75. #define PIOCOPENM    (PIOC|33)    /* open mapped object for reading */
  76. #define PIOCCRED    (PIOC|34)    /* get process credentials */
  77. #define PIOCGROUPS    (PIOC|35)    /* get supplementary groups */
  78. /*
  79.  * These are new with SVR4
  80.  */
  81. #define PIOCSET        (PIOC|38)    /* set modes of operation */
  82. #define PIOCRESET    (PIOC|39)    /* reset modes of operation */
  83. #define PIOCNWATCH    (PIOC|40)    /* get # watch points */
  84. #define PIOCGWATCH    (PIOC|41)    /* get watch point */
  85. #define PIOCSWATCH    (PIOC|42)    /* set watch point */
  86. #define PIOCUSAGE    (PIOC|43)    /* get prusage_t structure */
  87. /* SGI calls */
  88. #define    PIOCGETINODE    (PIOC|102)    /* get inode (fd) information */
  89. #ifdef CKPT
  90. /*
  91.  * 200-230 reserved for checkpoint/restart
  92.  */
  93. #endif
  94.  
  95. /*
  96.  * The following calls manipulate 
  97.  * the R10000 event counters. 
  98.  */
  99. #define PIOCENEVCTRS    (PIOC|233)     /* acquire and start event counters */
  100. #define PIOCRELEVCTRS    (PIOC|234)    /* release/stop event counters */
  101. #define PIOCGETEVCTRS    (PIOC|235)    /* dump out the counters */
  102. #define PIOCGETPREVCTRS    (PIOC|236)    /* dump counters and prusage info */
  103. #define PIOCGETEVCTRL    (PIOC|237)    /* get control info for counters */
  104. #define PIOCSETEVCTRL    (PIOC|238)    /* set control info for counters */
  105. #define PIOCSAVECCNTRS  (PIOC|239)    /* parent gets child cntrs (no wait) */
  106. #define PIOCENEVCTRSEX    (PIOC|240)     /* acquire and start event counters */
  107. #define PIOCGETEVCTRLEX    (PIOC|241)    /* get control info for counters */
  108.  
  109. #define PIOCPGD_SGI    (PIOC|248)    /* (SGI) get page tbl information */
  110. #define PIOCMAP_SGI    (PIOC|249)    /* (SGI) get region map information */
  111. #define PIOCGETPTIMER    (PIOC|250)    /* get process timers */
  112. #define PIOCTLBMISS    (PIOC|251)    /* turn tlbmiss accounting on/off */
  113. #define PIOCACINFO    (PIOC|252)    /* get current process acct info */
  114. #define PIOCGETSN0REFCNTRS    (PIOC|253)    /* get SN0 page ref cnts*/
  115.  
  116. /* arguments for PIOCTLBMISS */
  117. #define TLB_STD        0x0
  118. #define TLB_COUNT    0x1
  119.  
  120. /*
  121.  * Magic cookies to tell procfs that the caller is ready for 64 bit formats
  122.  * even though it was compiled in a 32 bit abi.
  123.  */
  124. #define PIOC_IRIX5_64    (1<<16)
  125. #define PIOC_IRIX5_N32    (1<<17)
  126.  
  127. #define PRSYSARGS    6        /* max number of syscall arguments */
  128.  
  129. typedef struct prstatus {
  130.     ulong_t        pr_flags;    /* Process flags */
  131.     short        pr_why;        /* Reason for process stop */
  132.     short        pr_what;    /* More detailed reason */
  133.     short        pr_cursig;    /* Current signal */
  134.     sigset_t    pr_sigpend;    /* Set of pending signals */
  135.     sigset_t    pr_sighold;    /* Set of held signals */
  136.     struct siginfo    pr_info;    /* info assoc. with signal or fault */
  137.     struct sigaltstack pr_altstack;    /* Alternate signal stack info */
  138.     sigaction_t    pr_action;    /* Signal action for current signal */
  139.     long        pr_syscall;    /* syscall number (if in syscall) */
  140.     long        pr_nsysarg;    /* number of arguments to syscall */
  141.     long        pr_errno;    /* error number from system call */
  142. #if (_MIPS_SIM == _ABIN32)
  143.     __int64_t    pr_rval1;    /* syscall return value 1 */
  144.     __int64_t    pr_rval2;    /* syscall return value 2 */
  145.     __int64_t    pr_sysarg[PRSYSARGS];    /* syscall arguments */
  146. #else
  147.     long        pr_rval1;    /* syscall return value 1 */
  148.     long        pr_rval2;    /* syscall return value 2 */
  149.     long        pr_sysarg[PRSYSARGS];    /* syscall arguments */
  150. #endif
  151.     pid_t        pr_pid;        /* Process id */
  152.     pid_t        pr_ppid;    /* Parent process id */
  153.     pid_t        pr_pgrp;    /* Process group id */
  154.     pid_t        pr_sid;        /* Session id */
  155.     timespec_t    pr_utime;    /* Process user cpu time */
  156.     timespec_t    pr_stime;    /* Process system cpu time */
  157.     timespec_t    pr_cutime;    /* Sum of children's user times */
  158.     timespec_t    pr_cstime;    /* Sum of children's system times */
  159.     char        pr_clname[8];    /* Scheduling class name */
  160.     long        pr_filler[20];    /* Filler area for future expansion */
  161.     inst_t        pr_instr;    /* Current instruction */
  162.     gregset_t    pr_reg;        /* General registers */
  163. } prstatus_t;
  164.   
  165.  
  166. /* values for pr_flags */
  167. #define PR_STOPPED    0x0001    /* process is stopped */
  168. #define PR_ISTOP    0x0002    /* process is stopped on event of interest */
  169. #define PR_DSTOP    0x0004    /* process has stop directive in effect */
  170. #define PR_ASLEEP    0x0008    /* process is in an interruptible sleep */
  171. #define PR_FORK        0x0010    /* process has inherit-on-fork flag set. */
  172. #define PR_RLC        0x0020    /* process has run-on-last-close flag set. */
  173. #define PR_PTRACE    0x0040    /* process is traced with ptrace() too */
  174. #define PR_PCINVAL    0x0080    /* current pc is invalid */
  175. #define PR_STEP        0x0200    /* process has single step pending */
  176. #define PR_KLC        0x0400    /* process has kill-on-last-close flag set. */
  177. #define PR_ISKTHREAD    0x1000    /* process is a kernel thread */
  178.  
  179. /* values for pr_why */
  180. #define PR_REQUESTED    1    /* in the interest of binary compatibility, */
  181. #define PR_SIGNALLED    2    /* PR_REQUESTED thru PR_SYSEXIT match the   */
  182. #define PR_SYSENTRY    3    /* prior settings from proc.h               */
  183. #define PR_SYSEXIT    4
  184. #define PR_FAULTED    5
  185. #define PR_JOBCONTROL    6
  186. #define    PR_CHECKPOINT    7
  187.  
  188. typedef struct prrun {
  189.     ulong_t        pr_flags;    /* Flags */
  190.     sigset_t    pr_trace;    /* Set of signals to be traced */
  191.     sigset_t    pr_sighold;    /* Set of signals to be held */
  192.     fltset_t    pr_fault;    /* Set of faults to be traced */
  193.     caddr_t        pr_vaddr;    /* Virt. address at which to resume */
  194.     long        pr_filler[8];    /* Filler area for future expansion */
  195. } prrun_t ;
  196.  
  197. /* values for pr_flags */
  198. #define PRCSIG        0x0001    /* Clear current signal */
  199. #define PRCFAULT    0x0002    /* Clear current fault */
  200. #define PRSTRACE    0x0004    /* set traced signals from pr_trace */
  201. #define PRSHOLD        0x0008    /* set held signals from pr_sighold */
  202. #define PRSFAULT    0x0010    /* set fault tracing mask from pr_trace */
  203. #define PRSVADDR    0x0020    /* set PC on resumption from pr_vaddr */
  204. #define PRSTEP        0x0040    /* single step the process */
  205. #define PRSABORT    0x0080    /* abort current system call */
  206. #define PRSTOP        0x0100    /* stop as soon as possible */
  207. #define PRCSTEP        0x0200    /* cancel outstanding single step */
  208.  
  209. #ifdef _KERNEL
  210. #define KPRIFORK    0x0001    /* inherit-on-fork */
  211. #define KPRRLC        0x0002    /* run-on-last-close */
  212. #define KPRCLRHALT    0x0004    /* clear current halt reason */
  213. #define KPRSUIDEXEC    0x0008    /* internal flag for secure setuid exec() */
  214. #define KPRKLC        0x0020    /* kill-on-last-close */
  215. #endif
  216.  
  217. #define PRNODEV        (dev_t)(-1)     /* non-existent device */
  218. #define PRARGSZ        80        /* should match PSARGSZ in user.h */
  219. #define PRCOMSIZ    32        /* should match PSCOMSIZ in user.h */
  220.  
  221. typedef struct prpsinfo {
  222.     char    pr_state;    /* numeric process state */
  223.     char    pr_sname;    /* printable character representing pr_state */
  224.     char    pr_zomb;    /* !=0: process exited but not waited for */
  225.     char    pr_nice;    /* process priority */
  226.     ulong_t    pr_flag;    /* process flags */
  227.     uid_t    pr_uid;        /* real user id */
  228.     gid_t    pr_gid;        /* real group id */
  229.     pid_t    pr_pid;        /* process id */
  230.     pid_t    pr_ppid;    /* parent process id */
  231.     pid_t    pr_pgrp;    /* pid of process group leader */
  232.     pid_t    pr_sid;        /* session id */
  233.     caddr_t    pr_addr;    /* physical address of process */
  234.     long    pr_size;    /* process image size in pages */
  235.     long    pr_rssize;    /* resident set size in pages */
  236.     caddr_t    pr_wchan;    /* wait addr for sleeping process */
  237.     timespec_t    pr_start;    /* process start time */
  238.     timespec_t    pr_time;    /* usr+sys cpu time for this process */
  239.     long    pr_pri;        /* priority */
  240.     long    pr_oldpri;    /* pre-svr4 priority */
  241.     char    pr_cpu;        /* pre-svr4 cpu usage */
  242.     dev_t    pr_ttydev;    /* controlling tty */
  243.     char    pr_clname[8];    /* scheduling class name */
  244.     char    pr_fname[PRCOMSIZ];    /* basename of exec()'d pathname */
  245.     char    pr_psargs[PRARGSZ];    /* initial chars of arg list */
  246.     uint_t    pr_spare1;    /* spare */
  247.     cpuid_t    pr_sonproc;    /* processor running on */
  248.     timespec_t     pr_ctime;       /* usr+sys cpu time for all children */
  249.     uid_t    pr_spare2;    /* spare */
  250.     pid_t    pr_spid;    /* sproc id */
  251.     timespec_t    pr_qtime;    /* cumulative cpu time process */
  252.     long    pr_fill[13];    /* spares */
  253. } prpsinfo_t;
  254.  
  255. /* values for pr_flag
  256.  * This used to just be a copy of the p_flag field in the proc structure.
  257.  * However, this is a waste, since ps only looks at the bottom 8 bits, so
  258.  * additional state bits can be defined here to pass out to ps(1) and other
  259.  * programs which make use of the PIOCPSINFO ioctl on the procfs file system.
  260.  */
  261. #define    PR_FLAG_PROC    0x00FF    /* Take these bits from p->p_flag field */
  262. #define PR_FLAG_KTHREAD    0x0100    /* Set this bit if looking at a kthread. */
  263. #define PR_FLAG_MASK    0x01FF    /* All bits that can be set in pr_flag */
  264.  
  265. typedef struct prmap {
  266.     caddr_t    pr_vaddr;    /* Virtual base address */
  267.     ulong_t    pr_size;    /* Size of mapping in bytes */
  268. #if (_MIPS_SIM == _ABIN32)
  269.     off_t        pr_off;    /* Offset into mapped object, if any */
  270. #else
  271.     __scoff_t    pr_off;    /* Offset into mapped object, if any */
  272. #endif
  273.     ulong_t    pr_mflags;    /* Protection and attribute flags */
  274.     long    pr_fill[4];    /* spares */
  275. } prmap_t;
  276.  
  277. typedef struct prmap_sgi {
  278.     caddr_t    pr_vaddr;    /* Virtual base address */
  279.     ulong_t    pr_size;    /* Size of mapping in bytes */
  280. #if (_MIPS_SIM == _ABIN32)
  281.     off_t    pr_off;        /* Offset into mapped object, if any */
  282. #else
  283.     __scoff_t pr_off;    /* Offset into mapped object, if any */
  284. #endif
  285.     ulong_t    pr_mflags;    /* Protection and attribute flags */
  286.                 /* non PYHS type region information... */
  287.     pgno_t    pr_vsize;    /* # of valid pages in this region */
  288.     pgno_t    pr_psize;    /* # of private pages in this region */
  289.     pgno_t    pr_wsize;    /* # of pages in region weighted base 256 */
  290.     pgno_t    pr_rsize;    /* # of referenced pages in this region */
  291.     pgno_t    pr_msize;    /* # of modified pages in this region */
  292.     dev_t    pr_dev;        /* Device # of region iff mapped */
  293. #if ((_MIPS_SIM == _ABIN32) || (_MIPS_SIM == _ABI64) || !defined(_KERNEL))
  294.     ino_t    pr_ino;        /* Inode # of region iff mapped */
  295. #else
  296.     __uint32_t pr_ino;    /* Inode # of region iff mapped */
  297. #endif
  298.     ushort_t pr_lockcnt;    /* lock count */
  299.     char    pr_fill[5*sizeof(long)-sizeof(short)];    /* spares */
  300. } prmap_sgi_t;
  301.  
  302. typedef struct prmap_sgi_arg {
  303.     caddr_t    pr_vaddr;    /* Virtual pointer to base of map buffer */
  304.     ulong_t    pr_size;    /* Size of user's map buffer in bytes */
  305. } prmap_sgi_arg_t;
  306.  
  307. /* flag values in pr_mflags */
  308. #define MA_READ        0x0001    /* mapping has readable permission */
  309. #define MA_WRITE    0x0002    /* mapping has writable permission */
  310. #define MA_EXEC        0x0004    /* mapping has executable permission */
  311. #define MA_SHARED    0x0008    /* mapping is a shared or mapped object */
  312. #define MA_BREAK    0x0010    /* mapping is grown by brk(2) */
  313. #define MA_STACK    0x0020    /* mapping is grown on stack faults */
  314. #define MA_PHYS        0x0040    /* mapping is a physical device */
  315. /* flag values added for prmap_sgi */
  316. #define    MA_PRIMARY    0x0800    /* mapping is part of primary object */
  317. #define MA_SREGION    0x1000    /* mapping is on shared region list */
  318. #define MA_COW        0x2000    /* mapping is set to copy on write */
  319. #define    MA_NOTCACHED    0x4000    /* mapping is not cacheable by process */
  320. #define MA_SHMEM    0x8000    /* mapping is a shmem() memory region */
  321. #define    MA_REFCNT_SHIFT        16    /* shift for region reference count */
  322. /* fractional base for pr_wsize */
  323. #define    MA_WSIZE_FRAC       256    /* base for pr_wsize */
  324.  
  325. /* WARNING: pgd_t is the same size for both 32 bit and 64 bit
  326.  * programs -- do not invalidate this assumption.
  327.  */
  328. typedef struct pgd {        /* per-page data */
  329.     short pr_flags;        /* flags */
  330.     short pr_value;        /* page use count /or/ vfault page offset */
  331. } pgd_t;
  332. typedef struct prpgd_sgi {
  333.     caddr_t    pr_vaddr;    /* virtual base address of region to stat */
  334.     pgno_t    pr_pglen;    /* number of pages in data list... */
  335.     pgd_t    pr_data[1];    /* variable length array of page flags */
  336. } prpgd_sgi_t;
  337.  
  338. /* flag values in prpgd_sgi pr_data.pr_flags */
  339. #define    PGF_REFERENCED    0x0001    /* page is hardware valid in region */
  340. #define    PGF_GLOBAL    0x0002    /* page is hardware global in region */
  341. #define    PGF_WRITEABLE    0x0004    /* page is hardware writeable in region */
  342. #define    PGF_NOTCACHED    0x0008    /* page is not hardware cached in region */
  343. #define    PGF_ISVALID    0x0010    /* page is valid */
  344. #define    PGF_ISDIRTY    0x0020    /* page is dirty */
  345. #define PGF_PRIVATE    0x0040    /* page is private (reference count == 1) */
  346. #define PGF_FAULT    0x0080    /* page fault offset stored pr_value */
  347. #define    PGF_SWAPPED    0x0100    /* page has been swapped in the past */
  348. #define    PGF_ANONBACK    0x0200    /* page is backed by swap */
  349. #define    PGF_USRHISTORY    0x0800    /* history flag reserved for the caller */
  350. #define PGF_REFHISTORY    0x1000    /* has page ever been marked hrdwr valid? */
  351. #define PGF_WRTHISTORY    0x2000    /* has page ever been marked hrdwr dirty? */
  352. #define PGF_VALHISTORY    0x4000    /* has page ever been marked softw valid? */
  353. #define PGF_CLEAR    0x8000    /* clear hardware REF/WRT for this page */
  354. #define    PGF_NONHIST    0xF800    /* mask to clear per call flags */
  355.  
  356. /* WARNING: prcred_t is the same size for both 32 bit and 64 bit
  357.  * programs -- do not invalidate this assumption.
  358.  */
  359. /* credentials structure */
  360. typedef struct prcred {
  361.     uid_t    pr_euid;    /* Effective user id */
  362.     uid_t    pr_ruid;    /* Real user id */
  363.     uid_t    pr_suid;    /* Saved user id (from exec) */
  364.     gid_t    pr_egid;    /* Effective group id */
  365.     gid_t    pr_rgid;    /* Real group id */
  366.     gid_t    pr_sgid;    /* Saved group id */
  367.     uint_t    pr_ngroups;    /* number of supplementary groups */
  368. } prcred_t;
  369.  
  370. /* watchpoints structure */
  371. typedef struct prwatch {
  372.     caddr_t pr_vaddr;
  373.     ulong_t    pr_size;
  374.     ulong_t    pr_wflags;
  375.     long    pr_filler;
  376. } prwatch_t;
  377.  
  378. /* prusage structure */
  379. typedef struct prusage {
  380.     timespec_t pu_tstamp;    /* time stamp */ 
  381.     timespec_t pu_starttime;    /* time process was started */ 
  382.     timespec_t pu_utime;    /* user CPU time */ 
  383.     timespec_t pu_stime;    /* system CPU time */ 
  384.     ulong_t pu_minf;    /* minor (mapping) page faults */
  385.     ulong_t pu_majf;    /* major (disk) page faults */
  386.     ulong_t pu_utlb;    /* user TLB misses */
  387.     ulong_t pu_nswap;    /* swaps (process only) */
  388.     ulong_t pu_gbread;    /* gigabytes ... */ 
  389.     ulong_t pu_bread;    /* and bytes read */
  390.     ulong_t pu_gbwrit;    /* gigabytes ... */ 
  391.     ulong_t pu_bwrit;    /* and bytes written */
  392.     ulong_t pu_sigs;    /* signals received */
  393.     ulong_t pu_vctx;    /* voluntary context switches */
  394.     ulong_t pu_ictx;    /* involuntary context switches */
  395.     ulong_t pu_sysc;    /* system calls */ 
  396.     ulong_t pu_syscr;    /* read() system calls */ 
  397.     ulong_t pu_syscw;    /* write() system calls */ 
  398.     ulong_t pu_syscps;    /* poll() or select() system calls */
  399.     ulong_t pu_sysci;    /* ioctl() system calls */ 
  400.     ulong_t pu_graphfifo;    /* graphics pipeline stalls */
  401.     ulong_t pu_graph_req[8];    /* graphics resource requests */
  402.     ulong_t pu_graph_wait[8];/* graphics resource waits */
  403.     ulong_t pu_size;    /* size of swappable image in pages */
  404.     ulong_t pu_rss;        /* resident set size */
  405.     ulong_t pu_inblock;    /* block input operations */
  406.     ulong_t pu_oublock;    /* block output operations */
  407.     ulong_t pu_vfault;    /* total number of vfaults */
  408.     ulong_t pu_ktlb;    /* kernel TLB misses */
  409. } prusage_t; 
  410.  
  411. /* pracinfo structure, for PIOCACINFO. Should be same size for */
  412. /* both 32-bit and 64-bit applications. The passing similarity */
  413. /* to the "sat_proc_acct" struct is not accidental.           */
  414. typedef struct pracinfo {
  415.     char        pr_version;    /* Accounting data version */
  416.     char        pr_flag;    /* Miscellaneous flags */
  417.     char        pr_nice;    /* Nice value */
  418.     unchar        pr_sched;    /* Scheduling discipline */
  419.                     /* (see sys/schedctl.h) */
  420.     __int32_t    pr_spare1;    /*   reserved */
  421.     ash_t        pr_ash;        /* Array session handle */
  422.     prid_t        pr_prid;    /* Project ID */
  423.     time_t        pr_btime;    /* Begin time (in secs since 1970)*/
  424.     time_t        pr_etime;    /* Elapsed time (in HZ) */
  425.     __int32_t    pr_spare2[2];    /*   reserved */
  426.      struct acct_timers pr_timers;    /* Assorted timers: see extacct.h */
  427.     struct acct_counts pr_counts;    /* Assorted counters: (ditto) */
  428.     __int64_t    pr_spare3[8];    /*   reserved */
  429. } pracinfo_t;
  430.  
  431. /* pracinfo.pr_flag */
  432. #define    AIF_FORK    0x80        /* has executed fork, but no exec */
  433. #define    AIF_SU        0x40        /* used privilege */
  434. #define AIF_NOUSER    0x01        /* no user data: some fields invalid */
  435.  
  436. /* prinodeinfo structure, for PIOCGETINODE */
  437. typedef struct prinodeinfo {
  438.     int        pi_fd;        /* input: process' file descriptor */
  439.     dev_t        pi_dev;        /* output: filesystem device for file */
  440.     ino64_t        pi_inum;    /* output: inode number of file */
  441.     uint32_t    pi_gen;        /* output: generation num for inode */
  442. } prinodeinfo_t;
  443.  
  444. /* values for pr_wflags - see MA_* */
  445.  
  446. /*
  447.  * Macros for manipulating sets of flags.
  448.  * sp must be a pointer to one of sigset_t, fltset_t, or sysset_t.
  449.  * flag must be a member of the enumeration corresponding to *sp.
  450.  */
  451.  
  452. /* turn on all flags in set */
  453. #define prfillset(sp) \
  454.     { register int _i_ = sizeof(*(sp))/sizeof(__uint32_t); \
  455.         while(_i_) ((__uint32_t*)(sp))[--_i_] = 0xFFFFFFFF; }
  456.  
  457. /* turn off all flags in set */
  458. #define premptyset(sp) \
  459.     { register int _i_ = sizeof(*(sp))/sizeof(__uint32_t); \
  460.         while(_i_) ((__uint32_t*)(sp))[--_i_] = 0L; }
  461.  
  462. /* is this set empty? */
  463. #define prisemptyset(set) \
  464.     (setisempty(set, sizeof(*(set))/sizeof(__uint32_t)))
  465.  
  466. /* turn on specified flag in set */
  467. #define praddset(sp, flag) \
  468.     (((unsigned)((flag)-1) < 32*sizeof(*(sp))/sizeof(__uint32_t)) \
  469.     && (((__uint32_t*)(sp))[((flag)-1)/32] |= (1L<<(((flag)-1)%32))))
  470.  
  471. /* turn off specified flag in set */
  472. #define prdelset(sp, flag) \
  473.     (((unsigned)((flag)-1) < 32*sizeof(*(sp))/sizeof(__uint32_t)) \
  474.     && (((__uint32_t*)(sp))[((flag)-1)/32] &= ~(1L<<(((flag)-1)%32))))
  475.  
  476. /* query: != 0 iff flag is turned on in set */
  477. #define prismember(sp, flag) \
  478.     (((unsigned)((flag)-1) < 32*sizeof(*(sp))/sizeof(__uint32_t)) \
  479.     && (((__uint32_t*)(sp))[((flag)-1)/32] & (1L<<(((flag)-1)%32))))
  480.  
  481.  
  482. #endif    /* _FS_PROCFS_PROCFS_H */
  483.